"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MapWatchState = function (state) {
    var res = {};
    if (typeof state === 'function') {
        state = state();
    }
    if (state && state.constructor === Array) {
        state.map(function (item) {
            res[item['state']] = {
                handler: function (curVal, oldVal) {
                    var funcEven = item['even'];
                    var even;
                    if (funcEven && typeof funcEven === 'function') {
                        even = item['even'].apply(this);
                    }
                    //   this.messageAlert(curVal,item['message'],even);
                    this.AutoMessage({ state: curVal, message: item['message'], even: even, error: item['error'] });
                },
                deep: true
            };
        });
    }
    return res;
};
